console.log(1)

chrome.contextMenus.create({
    title: "测试右键菜单",
    onclick: function(){alert('您点击了右键菜单！');}
});

// document.querySelectorAll("*").forEach(el => el.addEventListener('mouseup', e=> {if(e.button == 2){ e.cancelBubble=true; console.log(el.tagName);localStorage.setItem('disappear', el)}}))

/**
* 创建菜单
*/
// 1.添加hostname到白名单
chrome.contextMenus.create({
   "title" : `隐藏选择元素`,
   "type" : "normal",          // 菜单项类型 "checkbox", "radio","separator"
   "contexts" : ["page","frame"],     // 菜单项影响的页面元素 "anchor","image"
   "documentUrlPatterns":["*://*/*"],  // iframe的src匹配
   "targetUrlPatterns" : ["*://*/*"],  // href的匹配
   "onclick" : (e) => alert(e.target)       // 单击时的处理函数
});